
package biblio.service.aop.logging.interfaces;


import java.lang.reflect.Method;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.springframework.aop.AfterReturningAdvice;
import org.springframework.aop.MethodBeforeAdvice;
import org.springframework.aop.ThrowsAdvice;


/**
 * Universal advice is default interface for universal logging.
 * @author mephisto
 * 2011-10-26
 */
public interface UniversalAdvice extends AfterReturningAdvice, MethodBeforeAdvice,
        MethodInterceptor, ThrowsAdvice
{

    /**
     *
     * @param returnValue
     * @param method
     * @param args
     * @param target
     * @throws Throwable
     */
    void afterReturning(Object returnValue, Method method, Object[] args,
            Object target) throws Throwable;

    /**
     *
     * @param method
     * @param args
     * @param target
     * @param e
     * @throws Throwable
     */
    void afterThrowing(Method method, Object[] args, Object target, Exception e)
            throws Throwable;

    /**
     *
     * @param method
     * @param args
     * @param target
     * @throws Throwable
     */
    void before(Method method, Object[] args, Object target) throws Throwable;

    /**
     * 
     * @param invocation
     * @return
     * @throws Throwable
     */
    Object invoke(MethodInvocation invocation) throws Throwable;
}
